<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="hmg.common.CommonUtils"%>
<%@ page import="hmg.vo.BoardVO"%>
<%@ page import="java.util.List"%>
<%--
    JSP Name : jspName.jsp
    Description : 설명을 기술합니다.
    author Kim hyung soo
    since 2012. 10. 4.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 10. 4.     Kim hyung soo     최초 생성
--%>
<%
    List<BoardVO> imageList = (List<BoardVO>) request.getAttribute("ImageList");
    BoardVO prevPhotoListID = (BoardVO) request.getAttribute("PrevPhotoListID");
    BoardVO nextPhotoListID = (BoardVO) request.getAttribute("NextPhotoListID");
    Object photoListCompType = request.getAttribute("photoListCompType");

    String searchKeyword = CommonUtils.getDecodedParameter(request.getParameter("searchKeyword"), "");
%>
<script type="text/javascript" src="/hmg/js/web/kor/com/googleAnalytics.js"></script>
                        <span class="galleryLeft">
<%  if (prevPhotoListID != null) { %>
                            <a href="#prevPost" onclick="fn_view_photo(<%= prevPhotoListID.getListID() %>, <%= prevPhotoListID.getDispNo() %>, <%= photoListCompType %>);return false;"><img class="png24"src="/hmg/images/web/kor/grn/btn_galleryView_Left.png" alt="이전이미지"/></a>
<%  } %>
                        </span>

                        <div id="photo_gallery_wrapper">
                            <div id="photo_gallery_slider">
                                <div style="overflow: hidden;" class="photo_gallery_scroll">
                                    <div class="photo_scrollContainer">
                                        <div class="photo_gallery_panel">
<%
    if (imageList == null || imageList.size() == 0)
        out.println("                                            <img src=\"/hmg/images/logo.png\" />");
    else
        out.println("                                            <img src=\"" + imageList.get(0).getURL() + "\" width=\"632\" height=\"368\" border=\"0\" />");
%>
                                        </div>
<%
    if (imageList != null && imageList.size() > 0) {
        for (int idx = 1; idx < imageList.size(); idx++) {
            BoardVO image = imageList.get(idx);
%>
                                        <div class="photo_gallery_panel">
                                            <img src="<%= image.getURL() %>" alt="사진갤러리 이미지" />
                                        </div>
<%
        }
    }
%>
                                    </div>
                                    <div class="photo_gallery_Information">
                                        <p class="categoty"><%= imageList.get(0).getCompName() %></p>
                                        <p class="title" title="<%= imageList.get(0).getRemark() %>" style="width:98%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;"><%= imageList.get(0).getTitle() %></p>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <span class="galleryRight">
<%  if (nextPhotoListID != null) { %>
                            <a href="#nextPost" onclick="fn_view_photo(<%= nextPhotoListID.getListID() %>, <%= nextPhotoListID.getDispNo() %>, <%= photoListCompType %>);return false;"><img class="png24"src="/hmg/images/web/kor/grn/btn_galleryView_Right.png" alt="right"/></a>
<%  } %>
                        </span>

                        <div id="galley_thumbImg">
                            <ul>
<%
    for (int idx = 0; idx < imageList.size(); idx++) {
        BoardVO image = imageList.get(idx);
        String className = "";

        if (idx == 0)
            out.println("       <li class=\"on\"><img src=\"" + image.getURL() + "\" alt=\"사진갤러리 이미지\" /></li>");
        else if (idx + 1 >= imageList.size())
            out.println("       <li class=\"last\"><img src=\"" + image.getURL() + "\" alt=\"사진갤러리 이미지\" /></li>");
        else
            out.println("       <li><img src=\"" + image.getURL() + "\" alt=\"사진갤러리 이미지\" /></li>");
    }
%>
                            </ul>
                        </div>